package bai3;

import java.util.Scanner;

public class Configuration {
	private int id;
	private String name;
	private String space;
	private String version;
	public Configuration(){
		
	}
	public Configuration(int id, String name, String space, String version) {
		super();
		this.id = id;
		this.name = name;
		this.space = space;
		this.version = version;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSpace() {
		return space;
	}
	public void setSpace(String space) {
		this.space = space;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public Configuration inputConfiguration(){
		Scanner ip=new Scanner(System.in);
		System.out.println("Nhap Id: ");
		int id=Integer.parseInt(ip.nextLine());
		System.out.println("Nhap Name: ");
		String name=ip.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			name=ip.nextLine();
		}
		System.out.println("Nhap Space: ");
		String space=ip.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			name=ip.nextLine();
		}
		System.out.println("Nhap version: ");
		String version=ip.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			name=ip.nextLine();
		}
		Configuration cf=new Configuration(id,name,space,version);
		return cf;
	}
	public void display(Configuration cf){
		Scanner ip=new Scanner(System.in);
		System.out.println("Id: "+cf.id);
		System.out.println("Name: "+cf.name);
		System.out.println("Space: "+cf.space);
		System.out.println("Version: "+cf.version);
	}
}
